
#include<Lcode/l_main.h>

#include<list>
#include"../LcodeConv/LcodeConvertEngine.hpp"
#include"../cg/FunctionUnit.hpp"
#include"../cg/ProgramUnit.hpp"

ProgramUnit * program;
#ifdef __cplusplus
extern "C"{
#endif
/*
 * the entry of back end
 */
void run(L_Func* fn)
{
	LcodeConvertEngine lcode_converter;
	FunctionUnit * fn_unit = lcode_converter.convert(fn);
	fn_unit->code_gen();
	program->add_code_section(fn_unit);
}

#ifdef __cplusplus
}
#endif

